home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 143
/
(Vol 143) Nov 15 2011.iso
/
Games
/
aqua_cubes.swf
/
scripts
/
frame_83
/
DoAction_7.as
< prev
next >
Wrap
Text File
|
2011-11-15
|
5KB
|
213 lines
function disposeResult(list)
{
if(_root.gamemode == "survival")
{
game.timeOut += list.length * 100 + 50;
}
else
{
game.point += list.length;
}
}
function noMoreMove()
{
trace("noMoreMove");
_root.gamepause = true;
fx_no_move.play();
}
function afterNoMove()
{
trace("afterNoMove");
if(_root.gamemode == "survival")
{
levelTimeOut();
}
else
{
_root.gamepause = false;
board.randomBoard();
ctrl.resetGame();
fx_no_move.gotoAndPlay(1);
}
}
function levelTimeOut()
{
trace("levelTimeOut");
fx_over.play();
_root.gamepause = true;
}
function passLevel()
{
trace("passLevel");
_root.score += _root.timebonus;
_root.sp = 100;
fx_lvclear.play();
_root.gamepause = true;
}
function nextLevel()
{
trace("nextLevel");
_root.level = _root.level + 1;
if(_root.level >= 9)
{
_root.level = 9;
_root.so.data.enablesurvival = true;
}
resetLevel(_root.level);
}
function setLevel(lv)
{
var _loc3_ = undefined;
if(lv < 5)
{
_loc3_ = 5;
}
if(lv >= 5)
{
_loc3_ = 6;
}
if(_root.gamemode == "survival")
{
_loc3_ = 7;
}
var _loc4_ = undefined;
if(lv < 3)
{
_loc4_ = 3;
}
if(lv >= 3 and lv <= 6)
{
_loc4_ = 6;
}
if(lv > 6)
{
_loc4_ = 9;
}
game.playColor = _loc3_;
game.maxObstruct = _loc4_;
game.pointTarget = 102 + _root.level * 8;
game.linkTime = 15;
game.linkPercent = 9 + lv * 9;
}
function resetLevel(lv)
{
_root.level = lv;
game.timeOut = getTimer() + RUNOUT;
game.point = 0;
game.linkCreate = false;
gauge.gotoAndStop(1);
setLevel(lv);
bomb.gotoAndStop(1);
board.randomBoard();
ctrl.resetGame();
}
stop();
_root.gamepause = false;
_root.systpause = false;
_root.pa_syst._visible = false;
_root.level = 1;
_root.sp = 100;
_root.spMAX = 100;
_root.timebonus = 2160;
_root.score = 0;
removeClip();
_root.fx_over_origin.duplicateMovieClip("fx_over",_root.getNextHighestDepth());
_root.fx_over_origin._visible = false;
_root.fx_lvclear_origin.duplicateMovieClip("fx_lvclear",_root.getNextHighestDepth());
_root.fx_lvclear_origin._visible = false;
_root.sfx_hint = new Sound();
_root.sfx_hint.attachSound("sfx_hint.wav");
_root.onEnterFrame = function()
{
pauseChecker();
if(_root.gamemode == "story")
{
_root.sholevel = "Level " + _root.level;
_root.hint._alpha = 10 + _root.sp;
_root.b_survmenu._visible = false;
}
else if(_root.gamemode == "survival")
{
_root.sholevel = "Survival Mode";
_root.hint._visible = false;
_root.b_survmenu._visible = true;
}
if(_root.gamepause == false and _root.systpause == false)
{
if(game.pauseAt != undefined)
{
game.timeOut += getTimer() - game.pauseAt;
delete game.pauseAt;
}
_root.timebonus = _root.timebonus - 1;
if(_root.gamemode == "survival")
{
if(_root.score >= 500 && game.playColor != 8)
{
game.playColor = 8;
}
else if(_root.score >= 1000 && game.playColor != 9)
{
game.playColor = 9;
}
}
else
{
if(game.point > 10)
{
game.point -= 0.02;
}
_root.gauge.gotoAndStop(Math.floor(game.point * gauge._totalframes / game.pointTarget));
if(game.point >= game.pointTarget)
{
passLevel();
}
}
if(!ctrl.movable)
{
trace("--------no move-----------");
ctrl.movable = true;
noMoreMove();
}
var _loc2_ = game.timeOut - getTimer();
if(_root.gamemode == "story")
{
bomb.gotoAndStop(Math.floor(bomb._totalframes - _loc2_ * bomb._totalframes / RUNOUT));
if(_loc2_ <= 0)
{
levelTimeOut();
}
}
var _loc3_ = Math.floor((RUNOUT - _loc2_) / 1000) % game.linkTime;
if(!game.linkCreate)
{
if(_loc3_ == game.linkTime - 1)
{
game.linkCreate = true;
if(Math.floor(Math.random() * 100) < game.linkPercent)
{
trace("link create");
ctrl.randomLink();
}
}
}
else if(_loc3_ == 0)
{
game.linkCreate = false;
}
}
else if(game.pauseAt == undefined)
{
game.pauseAt = getTimer();
}
};
var RUNOUT = 90000;
if(_root.gamemode == "survival")
{
resetLevel(_root.survivalstartLV);
}
else
{
resetLevel(_root.storystartLV);
}